home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / hs_inst.zip / HS-GAP51.ZIP / FLISTCNV.PAS < prev    next >
Pascal/Delphi Source File  |  1991-11-14  |  873b  |  52 lines

  1.  
  2.  
  3. function trimit (ln: string): string;
  4. var
  5.    i: integer;
  6.    
  7. begin
  8.    
  9.    for i := 1 to length(ln) do
  10.       if ln[i]= #0 then
  11.          ln[i]:= ' ';
  12.    
  13.    while ln[length(ln)] = ' ' do
  14.       dec(ln[0]);
  15.    
  16.    trimit := ln;
  17. end;
  18.  
  19.  
  20. type
  21.    thefile = record
  22.          fname:  array[1..12] of char;
  23.          junk1:  char;
  24.          dir:    array[1..25] of char;
  25.          junk2:  array[1..4] of char;
  26.    end;
  27.    
  28. var
  29.    i:    integer;
  30.    cnv:  thefile;
  31.    fd1:  file of thefile;
  32.    fd2:  text;
  33.    
  34. begin
  35.    assign(fd1, 'filelst.dwn');
  36.    reset(fd1);
  37.    assign(fd2, 'filelist');
  38.    rewrite(fd2);
  39.    
  40.    for i := 1 to filesize (fd1) do
  41.    begin
  42.       read(fd1, cnv);
  43.       writeln('[',cnv.dir,'] [', cnv.fname,']');
  44.       writeln(fd2, trimit (cnv.dir), '\', trimit (cnv.fname));
  45.    end;
  46.    
  47.    close(fd2);
  48.    close(fd1);
  49.  
  50. end.
  51.  
  52.